<script type="text/javascript">
$(document).ready(function()
{
    var url = location.href;
    var str = url.replace(/^.*#/, '');
    var temp = str.split(/:/);
    if (temp[1])
    {
        var msg = temp[1].split(/=/);
        $('#message[message="' + msg[1] + '"]').trigger('click');
    }
});
</script>

<tr>
    <td class="content">
            <div class="wrapper">
                    <h1 class="ml">Список уведомлений:</h1>
            </div>
            <div class="wrapper">
            <table border="1">
            <tr>
                <td></td>
                <td>Время</td>
                <td>Тема</td>
                <td>Сообщение</td>
                <td>От кого</td>
                <td>Прочитано</td>
                <td>Действия</td>
            </tr>
            {% set i = count %}
            {% for message in messages %}
            <tr>
                <td>{{ i }})</td>
                {% set i = i - 1 %}
                <td>{{ message.getCreatedAt() | date("d M Y H:i:s") }}</td>
                <td>{{ message.getTheme() }}</td>
                <td>{{ message.getMessage() }}</td>
                <td>{{ users[message.getUserFrom()] }}</td>
                <td>{{ message.getWasRead() ? '+' : '-' }}</td>
                <td>
                    <table>
                    <tr>
                        <td>
                            <div id="message" message="{{ message.getId() }}">
                                <div name="message_human_link" action="message" message="{{ message.getId() }}">
                                    <a href="">Просмотреть</a>
                                </div>
                            </div>
                        </td>
                    </tr>
                    </table>
                </td>
            </tr>
            {% endfor %}
            </div>
            <div class="end"></div>
    </td>
</tr>
